﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<VictorBlaga.DocumentManagement.Models.UserViewModel>" %>
<%@ Import Namespace="VictorBlaga.DocumentManagement.Core.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create a new user
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Create a new user</h2>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Fields</legend>
            <p>
                <label for="Username">Username:</label>
                <%= Html.TextBox("Username") %>
                <%= Html.ValidationMessage("Username", "*") %>
            </p>
            <p>
                <label for="Firstname">Firstname:</label>
                <%= Html.TextBox("Firstname") %>
                <%= Html.ValidationMessage("Firstname", "*") %>
            </p>
            <p>
                <label for="Lastname">Lastname:</label>
                <%= Html.TextBox("Lastname") %>
                <%= Html.ValidationMessage("Lastname", "*") %>
            </p>
            <p>
                <label for="Email">Email:</label>
                <%= Html.TextBox("Email") %>
                <%= Html.ValidationMessage("Email", "*") %>
            </p>
            <p>
                <label for="UserLevel">Role:</label>
                <div class="editor-field">
                    <table>
                        <tr>
                        <%foreach(var i in Enum.GetValues(typeof(UserLevels))){ %>
                            <td>
                                <%= Enum.GetName(typeof(UserLevels),i) %>
                                <%= Html.RadioButtonFor(m => m.UserLevel, (int)i) %>
                            </td>
                        <%} %>
                    </tr>
                    </table>
                </div>
                <%= Html.ValidationMessage("UserLevel", "*") %>
            </p>
            <p>           
            <label for="WorkshopID">Workshop</label>
                <%= Html.DropDownListFor(model => model.WorkshopID, Model.WorkshopList, "None") %>
                <%= Html.ValidationMessageFor(model => model.WorkshopID, "*") %>
            </p>
            <p>
                <label for="Password">Password:</label>
                <%= Html.Password("Password")%>
                <%= Html.ValidationMessage("Password", "*")%>
            </p>
            <p>
                <label for="PasswordConfirm">Password confirmation:</label>
                <%= Html.Password("PasswordConfirm")%>
                <%= Html.ValidationMessage("PasswordConfirm", "*")%>
            </p>
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>

    <% } %>
    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>

